//
//  HSSubjectiveTableViewCell.swift
//  HomeSchoolDemo
//
//  Created by rimi on 2016/10/13.
//  Copyright © 2016年 黄华强. All rights reserved.
//

import UIKit

class HSSubjectiveTableViewCell: UITableViewCell {

    var ht_titleLabel:UILabel!
   
     var ht_contentView:HSSubjectiveView!
    
    var model:HSHW_htViewModel? {
        didSet {
            setupUI()
        }
    }
    
    func setupUI() {
        
        ht_titleLabel = UILabel(title: model?.details.ht_title ?? "", color: UIColor().colorWithHex(0x005780), fontSize: 15)
        ht_titleLabel.numberOfLines = 0
        contentView.addSubview(ht_titleLabel)
        
        ht_titleLabel.snp.makeConstraints { (make) in
            make.left.equalTo(8)
            make.right.equalTo(-screenW * 0.15)
            make.top.equalTo(8)
            
        }
        
        ht_contentView = HSSubjectiveView(frame: CGRect(x: 8, y: (model?.titleH)! + 16, width: screenW * 0.85, height: (model?.contentViewH)!))
        ht_contentView.backgroundColor = #colorLiteral(red: 0.6000000238, green: 0.6000000238, blue: 0.6000000238, alpha: 1)
        
        ht_contentView.model = model
        
        contentView.addSubview(ht_contentView)

        
        
        
    }

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
